package design.z1_observer.wechat;

import design.z1_observer.wechat.observer.Observer;
import design.z1_observer.wechat.observer.Observer1;
import design.z1_observer.wechat.observer.Observer2;
import design.z1_observer.wechat.subject.ObjectFor3D;

/**
 * 观察者模式
 * <p>
 * 模拟微信功公众号的订阅和推送
 */
public class TestObserver {

    public static void main(String[] args) {
        //模拟一个3D的服务号
        ObjectFor3D subjectFor3d = new ObjectFor3D();
        //客户1
        Observer observer1 = new Observer1(subjectFor3d);
        Observer observer2 = new Observer2(subjectFor3d);

        subjectFor3d.setMsg("20140420的3D号码是：127");
        subjectFor3d.setMsg("20140421的3D号码是：333");

    }

}
